window.onload=function(){
    renderShowNew(data.data, ".newsInfo");
    
    function renderShowNew(data, className) {
        var ulpt = document.querySelector(className);
        data.forEach(function (item) {
            var li = document.createElement("li");
            var div1 = document.createElement("div");
            var div2 = document.createElement("div");
            var p = document.createElement("p");
            p.innerText = item.title;
            var ul = document.createElement("ul");
            var li1 = document.createElement("li");
            li1.innerText = item.source;
            var li2 = document.createElement("li");
            // li2.innerText = item.
            var img = document.createElement("img");
            img.setAttribute("src", item.headpic);
            div1.appendChild(p);
            ul.appendChild(li1);
            ul.appendChild(li2);
            div1.appendChild(ul);
            div2.appendChild(img);
            li.appendChild(div1);
            li.appendChild(div2);
            ulpt.appendChild(li);
        });
        var moreLi = document.createElement("li");
        moreLi.innerText = "没有更多了！";
        moreLi.className = "textStyle";
        ulpt.appendChild(moreLi);
    }

}